<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Hardware Abstraction Layer (HAL)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="logo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Hardware Abstraction Layer (HAL)</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__group__hal__rtc.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">API Reference</a> &#124;
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">RTC (Real-Time Clock)<div class="ingroups"><a class="el" href="group__group__hal.html">HAL Drivers</a></div></div></div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p >High level interface for interacting with the real-time clock (RTC). </p>
<p >The real time clock provides tracking of the current time and date, as well as the ability to trigger a callback at a specific time in the future.</p>
<h1><a class="anchor" id="section_rtc_features"></a>
Features</h1>
<ul>
<li>Configurable interrupt and callback assignment on RTC event <a class="el" href="group__group__hal__rtc.html#ga65837a686b1fab2e3b11e0d3ba1fdafe">cyhal_rtc_event_t</a></li>
<li>Set alarm for a specific time and date <a class="el" href="group__group__hal__rtc.html#ga4281bd53cab53fb245a1e98a618e1679">cyhal_rtc_set_alarm</a></li>
<li>Daylight Savings Time adjustment</li>
</ul>
<h1><a class="anchor" id="section_rtc_quickstart"></a>
Quick Start</h1>
<p >Initialise the RTC using <a class="el" href="group__group__hal__rtc.html#ga913818691e0a742dea9172d1dc255f5b">cyhal_rtc_init</a>. Set the current time and date using <a class="el" href="group__group__hal__rtc.html#ga09180594a84d768f17d80e1262dce2b7">cyhal_rtc_write</a>. <br  />
 See <a class="el" href="group__group__hal__rtc.html#subsection_rtc_snippet_1">Snippet 1: Initialize RTC, write and read current time and date</a> to initialize RTC, read and write current date and time to the RTC peripheral. See <a class="el" href="group__group__hal__rtc.html#subsection_rtc_snippet_2">Snippet 2: RTC Alarm using Callbacks</a> to set an alarm event on a specific time and date.</p>
<h1><a class="anchor" id="section_rtc_snippets"></a>
Code snippets</h1>
<h2><a class="anchor" id="subsection_rtc_snippet_1"></a>
Snippet 1: Initialize RTC, write and read current time and date</h2>
<p >The following code snippet initialises the RTC using the <a class="el" href="group__group__hal__rtc.html#ga913818691e0a742dea9172d1dc255f5b">cyhal_rtc_init</a>. The current date and time are set using <a class="el" href="group__group__hal__rtc.html#ga09180594a84d768f17d80e1262dce2b7">cyhal_rtc_write</a>. The current date and time is read from the RTC using <a class="el" href="group__group__hal__rtc.html#ga5c3f15f870f2ecfb4a8a03a58d1eaa5f">cyhal_rtc_read</a>. The time structure <b> tm </b>, contains the calendar date and time which are broken down into its components. This structure is declared in standard C library time.h which is included by HAL. </p><div class="fragment"><div class="line">    <span class="comment">// Structure tm stores years since 1900</span></div>
<div class="line"><span class="preprocessor">    #define TM_YEAR_BASE (1900u)</span></div>
<div class="line"> </div>
<div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>   result;</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> my_rtc;</div>
<div class="line">    <span class="keywordtype">char</span>        buffer[80];</div>
<div class="line"> </div>
<div class="line">    <span class="keywordtype">int</span> mday = 3, month = 3, year = 2020; <span class="comment">// Day of month, month and year</span></div>
<div class="line">    <span class="keywordtype">int</span> hours = 8, minutes = 10, seconds = 10; <span class="comment">// Hours, minutes and seconds</span></div>
<div class="line">    <span class="keywordtype">int</span> wday = 3; <span class="comment">// Days from Sunday. Sunday is 0, Monday is 1 and so on.</span></div>
<div class="line">    <span class="keywordtype">int</span> dst  = 0; <span class="comment">// Daylight Savings. 0 - Disabled, 1 - Enabled</span></div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Setting the tm structure as 08 HRS:10 MIN:10 SEC ; 3rd March 2020; Wednesday ; DST off</span></div>
<div class="line">    <span class="keyword">struct </span>tm new_date_time =</div>
<div class="line">    {</div>
<div class="line">        .tm_sec   = seconds,</div>
<div class="line">        .tm_min   = minutes,</div>
<div class="line">        .tm_hour  = hours,</div>
<div class="line">        .tm_mday  = mday,</div>
<div class="line">        .tm_mon   = month - 1,</div>
<div class="line">        .tm_year  = year - TM_YEAR_BASE,</div>
<div class="line">        .tm_wday  = wday,</div>
<div class="line">        .tm_isdst = dst</div>
<div class="line">    };</div>
<div class="line">    <span class="keyword">struct </span>tm current_date_time = {0};</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Initialize RTC</span></div>
<div class="line">    result = <a class="code hl_function" href="group__group__hal__rtc.html#ga913818691e0a742dea9172d1dc255f5b">cyhal_rtc_init</a>(&amp;my_rtc);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Update the current time and date to the RTC peripheral</span></div>
<div class="line">    result = <a class="code hl_function" href="group__group__hal__rtc.html#ga09180594a84d768f17d80e1262dce2b7">cyhal_rtc_write</a>(&amp;my_rtc, &amp;new_date_time);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Get the current time and date from the RTC peripheral</span></div>
<div class="line">    result = <a class="code hl_function" href="group__group__hal__rtc.html#ga5c3f15f870f2ecfb4a8a03a58d1eaa5f">cyhal_rtc_read</a>(&amp;my_rtc, &amp;current_date_time);</div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == result)</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// strftime() is a C library function which can be used to format date and time</span></div>
<div class="line">        <span class="comment">// into string. It comes under the header file &quot;time.h&quot;.</span></div>
<div class="line">        <span class="comment">// (See http://www.cplusplus.com/reference/ctime/strftime/)</span></div>
<div class="line">        strftime(buffer, <span class="keyword">sizeof</span>(buffer), <span class="stringliteral">&quot;%c&quot;</span>, &amp;current_date_time);</div>
<div class="line">        <span class="comment">// Print the buffer in serial terminal to view the current date and time</span></div>
<div class="line">    }</div>
<div class="ttc" id="agroup__group__hal__impl__hw__types_html_structcyhal__rtc__t"><div class="ttname"><a href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a></div><div class="ttdoc">RTC object.</div><div class="ttdef"><b>Definition:</b> cyhal_hw_types.h:1159</div></div>
<div class="ttc" id="agroup__group__hal__rtc_html_ga09180594a84d768f17d80e1262dce2b7"><div class="ttname"><a href="group__group__hal__rtc.html#ga09180594a84d768f17d80e1262dce2b7">cyhal_rtc_write</a></div><div class="ttdeci">cy_rslt_t cyhal_rtc_write(cyhal_rtc_t *obj, const struct tm *time)</div><div class="ttdoc">Write the specified time and date to the RTC peripheral.</div></div>
<div class="ttc" id="agroup__group__hal__rtc_html_ga5c3f15f870f2ecfb4a8a03a58d1eaa5f"><div class="ttname"><a href="group__group__hal__rtc.html#ga5c3f15f870f2ecfb4a8a03a58d1eaa5f">cyhal_rtc_read</a></div><div class="ttdeci">cy_rslt_t cyhal_rtc_read(cyhal_rtc_t *obj, struct tm *time)</div><div class="ttdoc">Get the current time and date from the RTC peripheral.</div></div>
<div class="ttc" id="agroup__group__hal__rtc_html_ga913818691e0a742dea9172d1dc255f5b"><div class="ttname"><a href="group__group__hal__rtc.html#ga913818691e0a742dea9172d1dc255f5b">cyhal_rtc_init</a></div><div class="ttdeci">cy_rslt_t cyhal_rtc_init(cyhal_rtc_t *obj)</div><div class="ttdoc">Initialize the RTC peripheral.</div></div>
<div class="ttc" id="agroup__group__result_html_gaca79700fcc701534ce61778a9bcf57d1"><div class="ttname"><a href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a></div><div class="ttdeci">uint32_t cy_rslt_t</div><div class="ttdoc">Provides the result of an operation as a structured bitfield.</div><div class="ttdef"><b>Definition:</b> cy_result.h:438</div></div>
<div class="ttc" id="agroup__group__result_html_gaf58fac450d9fff4472f03ad68f6e546e"><div class="ttname"><a href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a></div><div class="ttdeci">#define CY_RSLT_SUCCESS</div><div class="ttdoc">cy_rslt_t return value indicating success</div><div class="ttdef"><b>Definition:</b> cy_result.h:465</div></div>
</div><!-- fragment --><h2><a class="anchor" id="subsection_rtc_snippet_2"></a>
Snippet 2: RTC Alarm using Callbacks</h2>
<p >The following code snippet configures the RTC to trigger an alarm event on a specified date and time using <a class="el" href="group__group__hal__rtc.html#ga4281bd53cab53fb245a1e98a618e1679">cyhal_rtc_set_alarm</a>. A callback is registered to handle the alarm event using <a class="el" href="group__group__hal__rtc.html#ga64761d1bb0c23aedc4329b50f8d3361d">cyhal_rtc_register_callback</a>. </p><div class="fragment"><div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> cyhal_rtc_alarm_interrupt_handler(<span class="keywordtype">void</span>* arg, <a class="code hl_enumeration" href="group__group__hal__rtc.html#ga65837a686b1fab2e3b11e0d3ba1fdafe">cyhal_rtc_event_t</a> event)</div>
<div class="line">{</div>
<div class="line">    (void)arg;</div>
<div class="line">    <span class="keywordflow">if</span> (event == <a class="code hl_enumvalue" href="group__group__hal__rtc.html#gga65837a686b1fab2e3b11e0d3ba1fdafea2bf87c0718ced4a1e2528575068bcc37">CYHAL_RTC_ALARM</a>)</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// ALARM HAS FIRED</span></div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> snippet_cyhal_set_alarm_callback(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <span class="comment">// Structure tm stores years since 1900</span></div>
<div class="line"><span class="preprocessor">    #define TM_YEAR_BASE (1900u)</span></div>
<div class="line"><span class="preprocessor">    #define RTC_CALLBACK_ARG (NULL)</span></div>
<div class="line"><span class="preprocessor">    #define RTC_INTERRUPT_PRIORITY (3u)</span></div>
<div class="line"> </div>
<div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>   result;</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> my_rtc;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Setting the tm structure as 08 HRS:10 MIN:10 SEC ; 3rd March 2020; Wednesday ; DST off</span></div>
<div class="line">    <span class="keyword">struct </span>tm new_date_time =</div>
<div class="line">    {</div>
<div class="line">        .tm_sec   = 10,</div>
<div class="line">        .tm_min   = 10,</div>
<div class="line">        .tm_hour  = 8,</div>
<div class="line">        .tm_mday  = 3,</div>
<div class="line">        .tm_mon   = 3 - 1,</div>
<div class="line">        .tm_year  = 2020 - TM_YEAR_BASE,</div>
<div class="line">        .tm_wday  = 3,</div>
<div class="line">        .tm_yday  = 61,</div>
<div class="line">        .tm_isdst = 0,</div>
<div class="line">    };</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Setting the tm structure to set alarm for 08 HRS:10 MIN:15 SEC ; 3rd March 2020; Wednesday ;</span></div>
<div class="line">    <span class="comment">// DST off</span></div>
<div class="line">    <span class="keyword">struct </span>tm alarm_date_time =</div>
<div class="line">    {</div>
<div class="line">        .tm_sec   = 15,</div>
<div class="line">        .tm_min   = 10,</div>
<div class="line">        .tm_hour  = 8,</div>
<div class="line">        .tm_mday  = 3,</div>
<div class="line">        .tm_mon   = 3 - 1,</div>
<div class="line">        .tm_year  = 2020 - TM_YEAR_BASE,</div>
<div class="line">        .tm_wday  = 3,</div>
<div class="line">        .tm_yday  = 61,</div>
<div class="line">        .tm_isdst = 0,</div>
<div class="line">    };</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Set which fields should match to trigger an alarm event. The fields are set to trigger an</span></div>
<div class="line">    <span class="comment">// alarm event on the date and time specified using alarm_date_time structure.</span></div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__rtc.html#structcyhal__alarm__active__t">cyhal_alarm_active_t</a> alarm_active =</div>
<div class="line">    {</div>
<div class="line">        .<a class="code hl_variable" href="group__group__hal__rtc.html#aa36c2142cb8a0dead7b6d40fcd499099">en_sec</a>   = 1,</div>
<div class="line">        .en_min   = 1,</div>
<div class="line">        .en_hour  = 1,</div>
<div class="line">        .en_day   =  1,</div>
<div class="line">        .en_date  = 1,</div>
<div class="line">        .en_month = 1,</div>
<div class="line">    };</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Initialize RTC</span></div>
<div class="line">    result = <a class="code hl_function" href="group__group__hal__rtc.html#ga913818691e0a742dea9172d1dc255f5b">cyhal_rtc_init</a>(&amp;my_rtc);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Update the current time and date to the RTC peripheral</span></div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == result)</div>
<div class="line">    {</div>
<div class="line">        result = <a class="code hl_function" href="group__group__hal__rtc.html#ga09180594a84d768f17d80e1262dce2b7">cyhal_rtc_write</a>(&amp;my_rtc, &amp;new_date_time);</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == result)</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// Register a callback function to handle the alarm event</span></div>
<div class="line">        <a class="code hl_function" href="group__group__hal__rtc.html#ga64761d1bb0c23aedc4329b50f8d3361d">cyhal_rtc_register_callback</a>(&amp;my_rtc,</div>
<div class="line">                                    (<a class="code hl_typedef" href="group__group__hal__rtc.html#ga2fe62b8562ac40925a243c75b0e6810f">cyhal_rtc_event_callback_t</a>)cyhal_rtc_alarm_interrupt_handler,</div>
<div class="line">                                    RTC_CALLBACK_ARG);</div>
<div class="line">        <span class="comment">// Enable the alarm event to trigger an interrupt</span></div>
<div class="line">        <a class="code hl_function" href="group__group__hal__rtc.html#ga92d82cf6e7ca376c5a41004d2d67cd4d">cyhal_rtc_enable_event</a>(&amp;my_rtc, <a class="code hl_enumvalue" href="group__group__hal__rtc.html#gga65837a686b1fab2e3b11e0d3ba1fdafea2bf87c0718ced4a1e2528575068bcc37">CYHAL_RTC_ALARM</a>, RTC_INTERRUPT_PRIORITY, <span class="keyword">true</span>);</div>
<div class="line"> </div>
<div class="line">        result = <a class="code hl_function" href="group__group__hal__rtc.html#ga4281bd53cab53fb245a1e98a618e1679">cyhal_rtc_set_alarm</a>(&amp;my_rtc, &amp;alarm_date_time, alarm_active);</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> result;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="ttc" id="agroup__group__hal__rtc_html_aa36c2142cb8a0dead7b6d40fcd499099"><div class="ttname"><a href="group__group__hal__rtc.html#aa36c2142cb8a0dead7b6d40fcd499099">cyhal_alarm_active_t::en_sec</a></div><div class="ttdeci">uint8_t en_sec</div><div class="ttdoc">Enable match of seconds.</div><div class="ttdef"><b>Definition:</b> cyhal_rtc.h:103</div></div>
<div class="ttc" id="agroup__group__hal__rtc_html_ga2fe62b8562ac40925a243c75b0e6810f"><div class="ttname"><a href="group__group__hal__rtc.html#ga2fe62b8562ac40925a243c75b0e6810f">cyhal_rtc_event_callback_t</a></div><div class="ttdeci">void(* cyhal_rtc_event_callback_t)(void *callback_arg, cyhal_rtc_event_t event)</div><div class="ttdoc">Handler for RTC events (eg: alarm)</div><div class="ttdef"><b>Definition:</b> cyhal_rtc.h:148</div></div>
<div class="ttc" id="agroup__group__hal__rtc_html_ga4281bd53cab53fb245a1e98a618e1679"><div class="ttname"><a href="group__group__hal__rtc.html#ga4281bd53cab53fb245a1e98a618e1679">cyhal_rtc_set_alarm</a></div><div class="ttdeci">cy_rslt_t cyhal_rtc_set_alarm(cyhal_rtc_t *obj, const struct tm *time, cyhal_alarm_active_t active)</div><div class="ttdoc">Set an alarm (interrupt) for the specified time and date using the RTC peripheral.</div></div>
<div class="ttc" id="agroup__group__hal__rtc_html_ga64761d1bb0c23aedc4329b50f8d3361d"><div class="ttname"><a href="group__group__hal__rtc.html#ga64761d1bb0c23aedc4329b50f8d3361d">cyhal_rtc_register_callback</a></div><div class="ttdeci">void cyhal_rtc_register_callback(cyhal_rtc_t *obj, cyhal_rtc_event_callback_t callback, void *callback_arg)</div><div class="ttdoc">Register a RTC event callback handler.</div></div>
<div class="ttc" id="agroup__group__hal__rtc_html_ga65837a686b1fab2e3b11e0d3ba1fdafe"><div class="ttname"><a href="group__group__hal__rtc.html#ga65837a686b1fab2e3b11e0d3ba1fdafe">cyhal_rtc_event_t</a></div><div class="ttdeci">cyhal_rtc_event_t</div><div class="ttdoc">RTC interrupt triggers.</div><div class="ttdef"><b>Definition:</b> cyhal_rtc.h:96</div></div>
<div class="ttc" id="agroup__group__hal__rtc_html_ga92d82cf6e7ca376c5a41004d2d67cd4d"><div class="ttname"><a href="group__group__hal__rtc.html#ga92d82cf6e7ca376c5a41004d2d67cd4d">cyhal_rtc_enable_event</a></div><div class="ttdeci">void cyhal_rtc_enable_event(cyhal_rtc_t *obj, cyhal_rtc_event_t event, uint8_t intr_priority, bool enable)</div><div class="ttdoc">Configure RTC event (eg: alarm) enablement.</div></div>
<div class="ttc" id="agroup__group__hal__rtc_html_gga65837a686b1fab2e3b11e0d3ba1fdafea2bf87c0718ced4a1e2528575068bcc37"><div class="ttname"><a href="group__group__hal__rtc.html#gga65837a686b1fab2e3b11e0d3ba1fdafea2bf87c0718ced4a1e2528575068bcc37">CYHAL_RTC_ALARM</a></div><div class="ttdeci">@ CYHAL_RTC_ALARM</div><div class="ttdoc">Alarm triggered event.</div><div class="ttdef"><b>Definition:</b> cyhal_rtc.h:97</div></div>
<div class="ttc" id="agroup__group__hal__rtc_html_structcyhal__alarm__active__t"><div class="ttname"><a href="group__group__hal__rtc.html#structcyhal__alarm__active__t">cyhal_alarm_active_t</a></div><div class="ttdoc">Defines which fields should be active for the alarm.</div><div class="ttdef"><b>Definition:</b> cyhal_rtc.h:102</div></div>
</div><!-- fragment --> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="groups" name="groups"></a>
API Reference</h2></td></tr>
<tr class="memitem:group__group__hal__results__rtc"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__results__rtc.html">RTC HAL Results</a></td></tr>
<tr class="memdesc:group__group__hal__results__rtc"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTC specific return codes. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:structcyhal__alarm__active__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__rtc.html#structcyhal__alarm__active__t">cyhal_alarm_active_t</a></td></tr>
<tr class="memdesc:structcyhal__alarm__active__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">Defines which fields should be active for the alarm.  <a href="group__group__hal__rtc.html#structcyhal__alarm__active__t">More...</a><br /></td></tr>
<tr class="separator:structcyhal__alarm__active__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:structcyhal__rtc__dst__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__rtc.html#structcyhal__rtc__dst__t">cyhal_rtc_dst_t</a></td></tr>
<tr class="memdesc:structcyhal__rtc__dst__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">Day Light Savings Time (DST) structure for setting when to apply.  <a href="group__group__hal__rtc.html#structcyhal__rtc__dst__t">More...</a><br /></td></tr>
<tr class="separator:structcyhal__rtc__dst__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:unioncyhal__rtc__dst__t_8____unnamed6____"><td class="memItemLeft" align="right" valign="top">union &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__rtc.html#unioncyhal__rtc__dst__t_8____unnamed6____">cyhal_rtc_dst_t.__unnamed6__</a></td></tr>
<tr class="separator:unioncyhal__rtc__dst__t_8____unnamed6____"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:structcyhal__rtc__dst__t_8____unnamed6_____8____unnamed8____"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__rtc.html#structcyhal__rtc__dst__t_8____unnamed6_____8____unnamed8____">cyhal_rtc_dst_t.__unnamed6__.__unnamed8__</a></td></tr>
<tr class="separator:structcyhal__rtc__dst__t_8____unnamed6_____8____unnamed8____"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga2fe62b8562ac40925a243c75b0e6810f"><td class="memItemLeft" align="right" valign="top"><a id="ga2fe62b8562ac40925a243c75b0e6810f" name="ga2fe62b8562ac40925a243c75b0e6810f"></a>
typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><b>cyhal_rtc_event_callback_t</b>) (void *callback_arg, <a class="el" href="group__group__hal__rtc.html#ga65837a686b1fab2e3b11e0d3ba1fdafe">cyhal_rtc_event_t</a> event)</td></tr>
<tr class="memdesc:ga2fe62b8562ac40925a243c75b0e6810f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handler for RTC events (eg: alarm) <br /></td></tr>
<tr class="separator:ga2fe62b8562ac40925a243c75b0e6810f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga65837a686b1fab2e3b11e0d3ba1fdafe"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__rtc.html#ga65837a686b1fab2e3b11e0d3ba1fdafe">cyhal_rtc_event_t</a> { <a class="el" href="group__group__hal__rtc.html#gga65837a686b1fab2e3b11e0d3ba1fdafea2bf87c0718ced4a1e2528575068bcc37">CYHAL_RTC_ALARM</a>
 }</td></tr>
<tr class="memdesc:ga65837a686b1fab2e3b11e0d3ba1fdafe"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTC interrupt triggers.  <a href="group__group__hal__rtc.html#ga65837a686b1fab2e3b11e0d3ba1fdafe">More...</a><br /></td></tr>
<tr class="separator:ga65837a686b1fab2e3b11e0d3ba1fdafe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga70f0bde8db19e6aacbbd72afc1fa3f9f"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__rtc.html#ga70f0bde8db19e6aacbbd72afc1fa3f9f">cyhal_rtc_dst_format_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__rtc.html#gga70f0bde8db19e6aacbbd72afc1fa3f9fa9e7d7fe4b4c2061b0e3fa66417fafe88">CYHAL_RTC_DST_RELATIVE</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__rtc.html#gga70f0bde8db19e6aacbbd72afc1fa3f9fabf285ab71718312d1764612ac46c78d1">CYHAL_RTC_DST_FIXED</a>
<br />
 }</td></tr>
<tr class="memdesc:ga70f0bde8db19e6aacbbd72afc1fa3f9f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enumeration used to configure the DST format.  <a href="group__group__hal__rtc.html#ga70f0bde8db19e6aacbbd72afc1fa3f9f">More...</a><br /></td></tr>
<tr class="separator:ga70f0bde8db19e6aacbbd72afc1fa3f9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga913818691e0a742dea9172d1dc255f5b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__rtc.html#ga913818691e0a742dea9172d1dc255f5b">cyhal_rtc_init</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *obj)</td></tr>
<tr class="memdesc:ga913818691e0a742dea9172d1dc255f5b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the RTC peripheral.  <a href="group__group__hal__rtc.html#ga913818691e0a742dea9172d1dc255f5b">More...</a><br /></td></tr>
<tr class="separator:ga913818691e0a742dea9172d1dc255f5b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7714ce41b80c1ac4161e8703f29d62d0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__rtc.html#ga7714ce41b80c1ac4161e8703f29d62d0">cyhal_rtc_init_cfg</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *obj, const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__configurator__t">cyhal_rtc_configurator_t</a> *cfg)</td></tr>
<tr class="memdesc:ga7714ce41b80c1ac4161e8703f29d62d0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the RTC peripheral using a configurator generated configuration struct.  <a href="group__group__hal__rtc.html#ga7714ce41b80c1ac4161e8703f29d62d0">More...</a><br /></td></tr>
<tr class="separator:ga7714ce41b80c1ac4161e8703f29d62d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4e9f272f48fcf83b09db4603c76b1d79"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__rtc.html#ga4e9f272f48fcf83b09db4603c76b1d79">cyhal_rtc_free</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *obj)</td></tr>
<tr class="memdesc:ga4e9f272f48fcf83b09db4603c76b1d79"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deinitialize RTC.  <a href="group__group__hal__rtc.html#ga4e9f272f48fcf83b09db4603c76b1d79">More...</a><br /></td></tr>
<tr class="separator:ga4e9f272f48fcf83b09db4603c76b1d79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac6891d0e8b9de6c32f46f179aa32b800"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__rtc.html#gac6891d0e8b9de6c32f46f179aa32b800">cyhal_rtc_is_enabled</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *obj)</td></tr>
<tr class="memdesc:gac6891d0e8b9de6c32f46f179aa32b800"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if the RTC has the time set and is counting.  <a href="group__group__hal__rtc.html#gac6891d0e8b9de6c32f46f179aa32b800">More...</a><br /></td></tr>
<tr class="separator:gac6891d0e8b9de6c32f46f179aa32b800"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5c3f15f870f2ecfb4a8a03a58d1eaa5f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__rtc.html#ga5c3f15f870f2ecfb4a8a03a58d1eaa5f">cyhal_rtc_read</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *obj, struct tm *time)</td></tr>
<tr class="memdesc:ga5c3f15f870f2ecfb4a8a03a58d1eaa5f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the current time and date from the RTC peripheral.  <a href="group__group__hal__rtc.html#ga5c3f15f870f2ecfb4a8a03a58d1eaa5f">More...</a><br /></td></tr>
<tr class="separator:ga5c3f15f870f2ecfb4a8a03a58d1eaa5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga09180594a84d768f17d80e1262dce2b7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__rtc.html#ga09180594a84d768f17d80e1262dce2b7">cyhal_rtc_write</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *obj, const struct tm *time)</td></tr>
<tr class="memdesc:ga09180594a84d768f17d80e1262dce2b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write the specified time and date to the RTC peripheral.  <a href="group__group__hal__rtc.html#ga09180594a84d768f17d80e1262dce2b7">More...</a><br /></td></tr>
<tr class="separator:ga09180594a84d768f17d80e1262dce2b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7cab520a921b70bcdd7794d08c14ce84"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__rtc.html#ga7cab520a921b70bcdd7794d08c14ce84">cyhal_rtc_write_direct</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *obj, uint32_t sec, uint32_t min, uint32_t hour, uint32_t day, uint32_t month, uint32_t year)</td></tr>
<tr class="memdesc:ga7cab520a921b70bcdd7794d08c14ce84"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write the specified time and date values to the RTC peripheral.  <a href="group__group__hal__rtc.html#ga7cab520a921b70bcdd7794d08c14ce84">More...</a><br /></td></tr>
<tr class="separator:ga7cab520a921b70bcdd7794d08c14ce84"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5e6893121f3be9026d5cf4cb10c008bf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__rtc.html#ga5e6893121f3be9026d5cf4cb10c008bf">cyhal_rtc_set_dst</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *obj, const <a class="el" href="group__group__hal__rtc.html#structcyhal__rtc__dst__t">cyhal_rtc_dst_t</a> *start, const <a class="el" href="group__group__hal__rtc.html#structcyhal__rtc__dst__t">cyhal_rtc_dst_t</a> *stop)</td></tr>
<tr class="memdesc:ga5e6893121f3be9026d5cf4cb10c008bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the start and end time for Day Light Savings.  <a href="group__group__hal__rtc.html#ga5e6893121f3be9026d5cf4cb10c008bf">More...</a><br /></td></tr>
<tr class="separator:ga5e6893121f3be9026d5cf4cb10c008bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3e56df18a9506e3d25050d4dabe7fd4c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__rtc.html#ga3e56df18a9506e3d25050d4dabe7fd4c">cyhal_rtc_is_dst</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *obj)</td></tr>
<tr class="memdesc:ga3e56df18a9506e3d25050d4dabe7fd4c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks to see if Day Light Savings Time is currently active.  <a href="group__group__hal__rtc.html#ga3e56df18a9506e3d25050d4dabe7fd4c">More...</a><br /></td></tr>
<tr class="separator:ga3e56df18a9506e3d25050d4dabe7fd4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4281bd53cab53fb245a1e98a618e1679"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__rtc.html#ga4281bd53cab53fb245a1e98a618e1679">cyhal_rtc_set_alarm</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *obj, const struct tm *time, <a class="el" href="group__group__hal__rtc.html#structcyhal__alarm__active__t">cyhal_alarm_active_t</a> active)</td></tr>
<tr class="memdesc:ga4281bd53cab53fb245a1e98a618e1679"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set an alarm (interrupt) for the specified time and date using the RTC peripheral.  <a href="group__group__hal__rtc.html#ga4281bd53cab53fb245a1e98a618e1679">More...</a><br /></td></tr>
<tr class="separator:ga4281bd53cab53fb245a1e98a618e1679"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2b3a85af9b9b878e8cae824d5f847b88"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__rtc.html#ga2b3a85af9b9b878e8cae824d5f847b88">cyhal_rtc_set_alarm_by_seconds</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *obj, const uint32_t seconds)</td></tr>
<tr class="memdesc:ga2b3a85af9b9b878e8cae824d5f847b88"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set an alarm (interrupt) at a specified number of seconds in the future.  <a href="group__group__hal__rtc.html#ga2b3a85af9b9b878e8cae824d5f847b88">More...</a><br /></td></tr>
<tr class="separator:ga2b3a85af9b9b878e8cae824d5f847b88"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga64761d1bb0c23aedc4329b50f8d3361d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__rtc.html#ga64761d1bb0c23aedc4329b50f8d3361d">cyhal_rtc_register_callback</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *obj, <a class="el" href="group__group__hal__rtc.html#ga2fe62b8562ac40925a243c75b0e6810f">cyhal_rtc_event_callback_t</a> callback, void *callback_arg)</td></tr>
<tr class="memdesc:ga64761d1bb0c23aedc4329b50f8d3361d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register a RTC event callback handler.  <a href="group__group__hal__rtc.html#ga64761d1bb0c23aedc4329b50f8d3361d">More...</a><br /></td></tr>
<tr class="separator:ga64761d1bb0c23aedc4329b50f8d3361d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga92d82cf6e7ca376c5a41004d2d67cd4d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__rtc.html#ga92d82cf6e7ca376c5a41004d2d67cd4d">cyhal_rtc_enable_event</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *obj, <a class="el" href="group__group__hal__rtc.html#ga65837a686b1fab2e3b11e0d3ba1fdafe">cyhal_rtc_event_t</a> event, uint8_t intr_priority, bool enable)</td></tr>
<tr class="memdesc:ga92d82cf6e7ca376c5a41004d2d67cd4d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure RTC event (eg: alarm) enablement.  <a href="group__group__hal__rtc.html#ga92d82cf6e7ca376c5a41004d2d67cd4d">More...</a><br /></td></tr>
<tr class="separator:ga92d82cf6e7ca376c5a41004d2d67cd4d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<hr/><h2 class="groupheader">Data Structure Documentation</h2>
<a name="structcyhal__alarm__active__t" id="structcyhal__alarm__active__t"></a>
<h2 class="memtitle"><span class="permalink"><a href="#structcyhal__alarm__active__t">&#9670;&nbsp;</a></span>cyhal_alarm_active_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct cyhal_alarm_active_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a id="aa36c2142cb8a0dead7b6d40fcd499099" name="aa36c2142cb8a0dead7b6d40fcd499099"></a>uint8_t</td>
<td class="fieldname">
en_sec: 1</td>
<td class="fielddoc">
Enable match of seconds. </td></tr>
<tr><td class="fieldtype">
<a id="a320940624827f9d754184447393a95f0" name="a320940624827f9d754184447393a95f0"></a>uint8_t</td>
<td class="fieldname">
en_min: 1</td>
<td class="fielddoc">
Enable match of minutes. </td></tr>
<tr><td class="fieldtype">
<a id="a8d9c92fe49428aedd8c78985a41f6967" name="a8d9c92fe49428aedd8c78985a41f6967"></a>uint8_t</td>
<td class="fieldname">
en_hour: 1</td>
<td class="fielddoc">
Enable match of hours. </td></tr>
<tr><td class="fieldtype">
<a id="af8fbeff616036b99a30ac05404420cb1" name="af8fbeff616036b99a30ac05404420cb1"></a>uint8_t</td>
<td class="fieldname">
en_day: 1</td>
<td class="fielddoc">
Enable match of day of week. </td></tr>
<tr><td class="fieldtype">
<a id="a3f14355696e229e8f2e8a8c03951cb22" name="a3f14355696e229e8f2e8a8c03951cb22"></a>uint8_t</td>
<td class="fieldname">
en_date: 1</td>
<td class="fielddoc">
Enable match of date in month. </td></tr>
<tr><td class="fieldtype">
<a id="aa3904e107ba274b3e28966fa87d175d1" name="aa3904e107ba274b3e28966fa87d175d1"></a>uint8_t</td>
<td class="fieldname">
en_month: 1</td>
<td class="fielddoc">
Enable match of month. </td></tr>
</table>

</div>
</div>
<a name="structcyhal__rtc__dst__t" id="structcyhal__rtc__dst__t"></a>
<h2 class="memtitle"><span class="permalink"><a href="#structcyhal__rtc__dst__t">&#9670;&nbsp;</a></span>cyhal_rtc_dst_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct cyhal_rtc_dst_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a id="a1811ad3e83ce0a73c208b42a42d33693" name="a1811ad3e83ce0a73c208b42a42d33693"></a><a class="el" href="group__group__hal__rtc.html#ga70f0bde8db19e6aacbbd72afc1fa3f9f">cyhal_rtc_dst_format_t</a></td>
<td class="fieldname">
format</td>
<td class="fielddoc">
DST format. <p >See /ref cyhal_rtc_dst_format_t. Based on this value other structure elements should be filled or could be ignored </p>
</td></tr>
<tr><td class="fieldtype">
<a id="a5270b5844693af6788a0a5da60ead51c" name="a5270b5844693af6788a0a5da60ead51c"></a>uint32_t</td>
<td class="fieldname">
hour</td>
<td class="fielddoc">
Hour in 24hour format, range[0-23]. </td></tr>
<tr><td class="fieldtype">
<a id="a072cbb462656c36db0b035fc9270b98c" name="a072cbb462656c36db0b035fc9270b98c"></a>union <a class="el" href="group__group__hal__rtc.html#unioncyhal__rtc__dst__t_8____unnamed6____">cyhal_rtc_dst_t.__unnamed6__</a></td>
<td class="fieldname">
__unnamed__</td>
<td class="fielddoc">
Anonymous union for the day as either a specific day (dayOfMonth) or as a week number (weekOfMonth) plus day of week (dayOfWeek) </td></tr>
<tr><td class="fieldtype">
<a id="a7063f23fa8e30374c3c6593d272dc99f" name="a7063f23fa8e30374c3c6593d272dc99f"></a>uint32_t</td>
<td class="fieldname">
month</td>
<td class="fielddoc">
Month value, range[1-12]. </td></tr>
</table>

</div>
</div>
<a name="unioncyhal__rtc__dst__t_8____unnamed6____" id="unioncyhal__rtc__dst__t_8____unnamed6____"></a>
<h2 class="memtitle"><span class="permalink"><a href="#unioncyhal__rtc__dst__t_8____unnamed6____">&#9670;&nbsp;</a></span>cyhal_rtc_dst_t.__unnamed6__</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">union cyhal_rtc_dst_t.__unnamed6__</td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a id="a79c2c19f09b65c5f0c478ddfa1d94217" name="a79c2c19f09b65c5f0c478ddfa1d94217"></a>uint32_t</td>
<td class="fieldname">
dayOfMonth</td>
<td class="fielddoc">
Day of Month, range[1-31]. </td></tr>
<tr><td class="fieldtype">
<a id="a63f5f87eab8bf5d1395b98caa0a448ba" name="a63f5f87eab8bf5d1395b98caa0a448ba"></a>struct <a class="el" href="group__group__hal__rtc.html#structcyhal__rtc__dst__t_8____unnamed6_____8____unnamed8____">cyhal_rtc_dst_t.__unnamed6__.__unnamed8__</a></td>
<td class="fieldname">
__unnamed__</td>
<td class="fielddoc">
Anonymous struct specifying the week number plus day of week. </td></tr>
</table>

</div>
</div>
<a name="structcyhal__rtc__dst__t_8____unnamed6_____8____unnamed8____" id="structcyhal__rtc__dst__t_8____unnamed6_____8____unnamed8____"></a>
<h2 class="memtitle"><span class="permalink"><a href="#structcyhal__rtc__dst__t_8____unnamed6_____8____unnamed8____">&#9670;&nbsp;</a></span>cyhal_rtc_dst_t.__unnamed6__.__unnamed8__</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct cyhal_rtc_dst_t.__unnamed6__.__unnamed8__</td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a id="ace4dee25729a2b40b820be71381ef6e8" name="ace4dee25729a2b40b820be71381ef6e8"></a>uint32_t</td>
<td class="fieldname">
dayOfWeek</td>
<td class="fielddoc">
Day of the week, starting on Sunday, range[0-6]. </td></tr>
<tr><td class="fieldtype">
<a id="abf56bc091977265c543ca16fd0189045" name="abf56bc091977265c543ca16fd0189045"></a>uint32_t</td>
<td class="fieldname">
weekOfMonth</td>
<td class="fielddoc">
Week of month, range[0-5]. <p >Where 5 =&gt; Last week of month </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga65837a686b1fab2e3b11e0d3ba1fdafe" name="ga65837a686b1fab2e3b11e0d3ba1fdafe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga65837a686b1fab2e3b11e0d3ba1fdafe">&#9670;&nbsp;</a></span>cyhal_rtc_event_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__rtc.html#ga65837a686b1fab2e3b11e0d3ba1fdafe">cyhal_rtc_event_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>RTC interrupt triggers. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga65837a686b1fab2e3b11e0d3ba1fdafea2bf87c0718ced4a1e2528575068bcc37" name="gga65837a686b1fab2e3b11e0d3ba1fdafea2bf87c0718ced4a1e2528575068bcc37"></a>CYHAL_RTC_ALARM&#160;</td><td class="fielddoc"><p >Alarm triggered event. </p>
</td></tr>
</table>

</div>
</div>
<a id="ga70f0bde8db19e6aacbbd72afc1fa3f9f" name="ga70f0bde8db19e6aacbbd72afc1fa3f9f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga70f0bde8db19e6aacbbd72afc1fa3f9f">&#9670;&nbsp;</a></span>cyhal_rtc_dst_format_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__rtc.html#ga70f0bde8db19e6aacbbd72afc1fa3f9f">cyhal_rtc_dst_format_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enumeration used to configure the DST format. </p>
<dl class="section note"><dt>Note</dt><dd>In areas of the world that practice DST, when it should begin and end is not unique. It can either be in fixed DST format or in relative DST format. </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga70f0bde8db19e6aacbbd72afc1fa3f9fa9e7d7fe4b4c2061b0e3fa66417fafe88" name="gga70f0bde8db19e6aacbbd72afc1fa3f9fa9e7d7fe4b4c2061b0e3fa66417fafe88"></a>CYHAL_RTC_DST_RELATIVE&#160;</td><td class="fielddoc"><p >Relative DST format. </p>
<p >eg: Begins on the last Sunday of March and ends on the last Sunday of October. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga70f0bde8db19e6aacbbd72afc1fa3f9fabf285ab71718312d1764612ac46c78d1" name="gga70f0bde8db19e6aacbbd72afc1fa3f9fabf285ab71718312d1764612ac46c78d1"></a>CYHAL_RTC_DST_FIXED&#160;</td><td class="fielddoc"><p >Fixed DST format. </p>
<p >eg: Begins on 21st March and ends on 21st September. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga913818691e0a742dea9172d1dc255f5b" name="ga913818691e0a742dea9172d1dc255f5b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga913818691e0a742dea9172d1dc255f5b">&#9670;&nbsp;</a></span>cyhal_rtc_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_rtc_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the RTC peripheral. </p>
<p >Power up the RTC in preparation for access. This function must be called before any other RTC functions are called. This does not change the state of the RTC. It just enables access to it. </p><dl class="section note"><dt>Note</dt><dd>Before calling this, make sure all necessary System Clocks are setup correctly. Generally this means making sure the RTC has access to a crystal oscillator for optimal accuracy and operation in low power. </dd>
<dd>
Previously set time configurations are retained. This will only reset the time if no prior configuration can be determined.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">obj</td><td>Pointer to an RTC object. The caller must allocate the memory for this object but the init function will initialize its contents. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the init request </dd></dl>

</div>
</div>
<a id="ga7714ce41b80c1ac4161e8703f29d62d0" name="ga7714ce41b80c1ac4161e8703f29d62d0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7714ce41b80c1ac4161e8703f29d62d0">&#9670;&nbsp;</a></span>cyhal_rtc_init_cfg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_rtc_init_cfg </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__configurator__t">cyhal_rtc_configurator_t</a> *&#160;</td>
          <td class="paramname"><em>cfg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the RTC peripheral using a configurator generated configuration struct. </p>
<p >Power up the RTC in preparation for access. This function must be called before any other RTC functions are called. This does not change the state of the RTC. It just enables access to it. NOTE: Before calling this, make sure all necessary System Clocks are setup correctly. Generally this means making sure the RTC has access to a crystal oscillator for optimal accuracy and operation in low power. NOTE: Previously set time configurations are retained. This will only reset the time if no prior configuration can be determined.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">obj</td><td>Pointer to an RTC object. The caller must allocate the memory for this object but the init function will initialize its contents. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cfg</td><td>Configuration structure generated by a configurator. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the init request </dd></dl>

</div>
</div>
<a id="ga4e9f272f48fcf83b09db4603c76b1d79" name="ga4e9f272f48fcf83b09db4603c76b1d79"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4e9f272f48fcf83b09db4603c76b1d79">&#9670;&nbsp;</a></span>cyhal_rtc_free()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_rtc_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Deinitialize RTC. </p>
<p >Frees resources associated with the RTC and disables CPU access. This only affects the CPU domain and not the time keeping logic. After this function is called no other RTC functions should be called except for rtc_init.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>RTC object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gac6891d0e8b9de6c32f46f179aa32b800" name="gac6891d0e8b9de6c32f46f179aa32b800"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac6891d0e8b9de6c32f46f179aa32b800">&#9670;&nbsp;</a></span>cyhal_rtc_is_enabled()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cyhal_rtc_is_enabled </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check if the RTC has the time set and is counting. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>RTC object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Whether the RTC is enabled or not </dd></dl>

</div>
</div>
<a id="ga5c3f15f870f2ecfb4a8a03a58d1eaa5f" name="ga5c3f15f870f2ecfb4a8a03a58d1eaa5f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5c3f15f870f2ecfb4a8a03a58d1eaa5f">&#9670;&nbsp;</a></span>cyhal_rtc_read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_rtc_read </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">struct tm *&#160;</td>
          <td class="paramname"><em>time</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the current time and date from the RTC peripheral. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>RTC object </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">time</td><td>The current time (see: <a href="https://en.cppreference.com/w/cpp/chrono/c/tm">https://en.cppreference.com/w/cpp/chrono/c/tm</a>) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the read request </dd></dl>

</div>
</div>
<a id="ga09180594a84d768f17d80e1262dce2b7" name="ga09180594a84d768f17d80e1262dce2b7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga09180594a84d768f17d80e1262dce2b7">&#9670;&nbsp;</a></span>cyhal_rtc_write()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_rtc_write </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const struct tm *&#160;</td>
          <td class="paramname"><em>time</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write the specified time and date to the RTC peripheral. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>RTC object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">time</td><td>The time to be set (see: <a href="https://en.cppreference.com/w/cpp/chrono/c/tm">https://en.cppreference.com/w/cpp/chrono/c/tm</a>) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the write request </dd></dl>

</div>
</div>
<a id="ga7cab520a921b70bcdd7794d08c14ce84" name="ga7cab520a921b70bcdd7794d08c14ce84"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7cab520a921b70bcdd7794d08c14ce84">&#9670;&nbsp;</a></span>cyhal_rtc_write_direct()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_rtc_write_direct </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>sec</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>hour</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>day</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>month</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>year</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write the specified time and date values to the RTC peripheral. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>RTC object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sec</td><td>Second to set (0-59) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">min</td><td>Minute to set (0-59) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">hour</td><td>Hour to set (0-23) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">day</td><td>Day of month to set (1-31) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">month</td><td>Month to set (1-12) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">year</td><td>4-digit year to set </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the write request </dd></dl>

</div>
</div>
<a id="ga5e6893121f3be9026d5cf4cb10c008bf" name="ga5e6893121f3be9026d5cf4cb10c008bf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5e6893121f3be9026d5cf4cb10c008bf">&#9670;&nbsp;</a></span>cyhal_rtc_set_dst()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_rtc_set_dst </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__group__hal__rtc.html#structcyhal__rtc__dst__t">cyhal_rtc_dst_t</a> *&#160;</td>
          <td class="paramname"><em>start</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__group__hal__rtc.html#structcyhal__rtc__dst__t">cyhal_rtc_dst_t</a> *&#160;</td>
          <td class="paramname"><em>stop</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the start and end time for Day Light Savings. </p>
<p >Calling this function will allow alarms to account for daylight saving time. This means that the RTC will be adjusted when a daylight saving time transition occurs, meaning times passed to <a class="el" href="group__group__hal__rtc.html#ga4281bd53cab53fb245a1e98a618e1679">cyhal_rtc_set_alarm()</a> will be interpreted as being in DST/not in DST as appropriate.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>RTC object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">start</td><td>When Day Light Savings time should start </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">stop</td><td>When Day Light Savings time should end </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the set_dst request </dd></dl>

</div>
</div>
<a id="ga3e56df18a9506e3d25050d4dabe7fd4c" name="ga3e56df18a9506e3d25050d4dabe7fd4c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3e56df18a9506e3d25050d4dabe7fd4c">&#9670;&nbsp;</a></span>cyhal_rtc_is_dst()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cyhal_rtc_is_dst </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Checks to see if Day Light Savings Time is currently active. </p>
<p >This should only be called after <a class="el" href="group__group__hal__rtc.html#ga5e6893121f3be9026d5cf4cb10c008bf">cyhal_rtc_set_dst()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>RTC object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Boolean indicating whether the current date/time is within the specified DST start/stop window. </dd></dl>

</div>
</div>
<a id="ga4281bd53cab53fb245a1e98a618e1679" name="ga4281bd53cab53fb245a1e98a618e1679"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4281bd53cab53fb245a1e98a618e1679">&#9670;&nbsp;</a></span>cyhal_rtc_set_alarm()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_rtc_set_alarm </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const struct tm *&#160;</td>
          <td class="paramname"><em>time</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__rtc.html#structcyhal__alarm__active__t">cyhal_alarm_active_t</a>&#160;</td>
          <td class="paramname"><em>active</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set an alarm (interrupt) for the specified time and date using the RTC peripheral. </p>
<p >This requires that a callback handler is registered by <a class="el" href="group__group__hal__rtc.html#ga64761d1bb0c23aedc4329b50f8d3361d">cyhal_rtc_register_callback</a> and that the <a class="el" href="group__group__hal__rtc.html#gga65837a686b1fab2e3b11e0d3ba1fdafea2bf87c0718ced4a1e2528575068bcc37">CYHAL_RTC_ALARM</a> event is enabled by <a class="el" href="group__group__hal__rtc.html#ga92d82cf6e7ca376c5a41004d2d67cd4d">cyhal_rtc_enable_event</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>RTC object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">time</td><td>The alarm time to be set (see: <a href="https://en.cppreference.com/w/cpp/chrono/c/tm">https://en.cppreference.com/w/cpp/chrono/c/tm</a>) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">active</td><td>The set of fields that are checked to trigger the alarm </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the set_alarm request </dd></dl>

</div>
</div>
<a id="ga2b3a85af9b9b878e8cae824d5f847b88" name="ga2b3a85af9b9b878e8cae824d5f847b88"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2b3a85af9b9b878e8cae824d5f847b88">&#9670;&nbsp;</a></span>cyhal_rtc_set_alarm_by_seconds()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_rtc_set_alarm_by_seconds </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint32_t&#160;</td>
          <td class="paramname"><em>seconds</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set an alarm (interrupt) at a specified number of seconds in the future. </p>
<p >This requires that a callback handler is registered by <a class="el" href="group__group__hal__rtc.html#ga64761d1bb0c23aedc4329b50f8d3361d">cyhal_rtc_register_callback</a> and that the <a class="el" href="group__group__hal__rtc.html#gga65837a686b1fab2e3b11e0d3ba1fdafea2bf87c0718ced4a1e2528575068bcc37">CYHAL_RTC_ALARM</a> event is enabled by <a class="el" href="group__group__hal__rtc.html#ga92d82cf6e7ca376c5a41004d2d67cd4d">cyhal_rtc_enable_event</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>RTC object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">seconds</td><td>The number of seconds in the future for the alarm to be set to. Because alarms cannot match the year (see <a class="el" href="group__group__hal__rtc.html#structcyhal__alarm__active__t">cyhal_alarm_active_t</a>) the maximum number of seconds allowed is 365d*24h*60m*60s == 31,536,000s </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the set_alarm_by_seconds request </dd></dl>

</div>
</div>
<a id="ga64761d1bb0c23aedc4329b50f8d3361d" name="ga64761d1bb0c23aedc4329b50f8d3361d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga64761d1bb0c23aedc4329b50f8d3361d">&#9670;&nbsp;</a></span>cyhal_rtc_register_callback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_rtc_register_callback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__rtc.html#ga2fe62b8562ac40925a243c75b0e6810f">cyhal_rtc_event_callback_t</a>&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>callback_arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register a RTC event callback handler. </p>
<p >This function will be called when one of the events enabled by <a class="el" href="group__group__hal__rtc.html#ga92d82cf6e7ca376c5a41004d2d67cd4d">cyhal_rtc_enable_event</a> occurs.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The RTC object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>The callback handler which will be invoked when the alarm event fires </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">callback_arg</td><td>Generic argument that will be provided to the callback when called </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga92d82cf6e7ca376c5a41004d2d67cd4d" name="ga92d82cf6e7ca376c5a41004d2d67cd4d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga92d82cf6e7ca376c5a41004d2d67cd4d">&#9670;&nbsp;</a></span>cyhal_rtc_enable_event()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_rtc_enable_event </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__rtc__t">cyhal_rtc_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__rtc.html#ga65837a686b1fab2e3b11e0d3ba1fdafe">cyhal_rtc_event_t</a>&#160;</td>
          <td class="paramname"><em>event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>intr_priority</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Configure RTC event (eg: alarm) enablement. </p>
<p >When an enabled event occurs, the function specified by <a class="el" href="group__group__hal__rtc.html#ga64761d1bb0c23aedc4329b50f8d3361d">cyhal_rtc_register_callback</a> will be called.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The RTC object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">event</td><td>The RTC event type </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">intr_priority</td><td>The priority for NVIC interrupt events </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">enable</td><td>True to turn on interrupts, False to turn off </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Hardware Abstraction Layer (HAL)</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
